import React from 'react';
import { Icon, Select } from 'antd';
// import { formatMessage } from 'umi';
import BizIcon from '@/components/BizIcon';
import styles from './index.less';

const { Option } = Select;

export default {
    UserName: {
        props: {
            size: 'large',
            id: 'userName',
            prefix: <BizIcon type="oa_signin_icon_user_default" />,
            placeholder: 'admin'
        },
        rules: [
            {
                required: true,
                message: 'Please enter username!'
            }
        ]
    },
    Password: {
        props: {
            size: 'large',
            prefix: <BizIcon type="oa_signin_icon_password_default" />,
            type: 'password',
            id: 'password',
            placeholder: 'password'
        },
        rules: [
            {
                required: true,
                message: 'Please enter password!'
            }
        ]
    },
    Mobile: {
        props: {
            size: 'large',
            prefix: <Icon type="mobile" className={styles.prefixIcon} />,
            placeholder: 'mobile number'
        },
        rules: [
            {
                required: true,
                message: 'Please enter mobile number!'
            },
            {
                pattern: /^1\d{10}$/,
                message: 'Wrong mobile number format!'
            }
        ]
    },
    Captcha: {
        props: {
            size: 'large',
            prefix: <Icon type="mail" className={styles.prefixIcon} />,
            placeholder: 'captcha'
        },
        rules: [
            {
                required: true,
                message: 'Please enter Captcha!'
            }
        ]
    },
    ImgCaptcha: {
        props: {
            size: 'large',
            placeholder: 'imgCaptcha'
        },
        rules: [
            {
                required: true,
                message: 'Please enter Captcha!'
            }
        ]
    },
    VerCode: {
        props: {
            size: 'large',
            prefix: <Icon type="robot" className={styles.prefixIcon} />,
            type: 'text',
            id: 'verCode',
            placeholder: 'verification code'
        },
        rules: [
            {
                required: true,
                message: 'Please enter Verification Code!'
            }
        ]
    },
    OrganizeType: {
        props: {
            size: 'large',
            prefix: <Icon type="robot" className={styles.prefixIcon} />,
            type: 'text',
            id: 'organizeType',
            placeholder: 'organize type'
        },
        rules: [
            {
                required: true,
                message: 'Please enter Organize Type!'
            }
        ],
        component: props => (
            <Select {...props}>
                <Option value="1">OA</Option>
                <Option value="2">商家</Option>
            </Select>
        )
    }
};
